#ifndef PATH_HPP
#define PATH_HPP
#include <string>
using std::string;
#include <vector>
using std::vector;

class Path
{
public:
	Path();
	Path(string str);
	Path(const char *str);
	
	string toString() const;
	
	bool isAbsolute() const;
	bool isRelative() const;
	int numComponents() const;
	string getComponent(int component) const;
	
	Path parent() const;
	Path relativize(const Path &base) const;
	Path resolve(const Path &base) const;
	Path toLocalURI() const;
	
	string basename() const;
	string dirname() const;
	string extension() const;
	
protected:
	void initFromStr(const char *str);
	void canonicalize();
	
	bool absolute;
	vector<string> components;
};

#endif
